<?php echo $this->partial('top.phtml',(array)$this->datatop)?>	
<script>

$(document).ready(function(){ 
    $("#ajax_form input[name=terminado]").addClass('ui-state-disabled').attr('disabled', true);
    checkTerminado();

    $("#ajax_form select[name=estado]").change(function () {
        checkTerminado()
	})
    
    $( "#ajax_form input[name=contrata]" ).ajaxComplete('/bitacora','contrata');
    $( "#ajax_form input[name=sala]" ).ajaxComplete('/bitacora','sala');

})

function checkTerminado(){
    var estado=$("#ajax_form select[name=estado]").val();       
    if(estado==7){
            $("#ajax_form input[name=terminado]").removeClass('ui-state-disabled').removeAttr('disabled').val('<?=Sgit_Filter_DateDbToForm::filter($this->row['terminado'],date('Y-m-d'))?>')
    }else{
            $("#ajax_form input[name=terminado]").addClass('ui-state-disabled').attr('disabled', true).val('')
    }
}


</script>


<?php

$this->form->setAction($this->url())->setAttrib('id', 'ajax_form');
echo $this->form;
echo $this->partial('form_js.phtml', array('id_tablesorter'=>$this->id_tablesorter,	'actionName'=>$this->actionName,'id'=>$this->id));


echo $this->partial('bottom.phtml',(array)$this->databottom);?>   	




